#! /usr/bin/env python

import os
from BuildUtility import create_build_utility

def options(opt):
    pass

def configure(conf):
    pass

def build(bld):
    build_util = create_build_utility(bld.env)

    source_dirs = []

    for platform in [build_util.get_target_os(), 'common']:
        d = platform
        if os.path.exists(os.path.join('src', platform)):
            source_dirs.extend(['%s/*.cpp' % platform])

    b = bld.stlib(features     = 'c cxx',
                  includes     = '. ..',
                  source       = bld.path.ant_glob(source_dirs),
                  target       = 'testmain')

    bld.install_files('${PREFIX}/include/testmain', 'common/testmain.h')
